﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" href="business/style/common.css">
    <script src="business/resource/js/jquery-1.11.1.min.js"></script>
    <script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="app/js/common.js"></script>
    <style>
        body{font-size:0.68267rem;}
    </style>
</head>

<body style="background-color:#FFF; ">

    <div class="header">
        <a href="javascript:history.back(-1);"  class="return">返回</a>
        <div class="write" >参与讨论</div>
    </div>
    <!--病例-详情-->
    <div class="case_view">
        <h1><?= $bingli_detail->data['title']?></h1>
        <div class="author">
            <script type="text/javascript">
                //=点击展开关闭效果=
                function openShutManager(oSourceObj,oTargetObj,shutAble,oOpenTip,oShutTip){
                    var sourceObj = typeof oSourceObj == "string" ? document.getElementById(oSourceObj) : oSourceObj;
                    var targetObj = typeof oTargetObj == "string" ? document.getElementById(oTargetObj) : oTargetObj;
                    var openTip = oOpenTip || "";
                    var shutTip = oShutTip || "";
                    if(targetObj.style.display!="none"){
                        if(shutAble) return;
                        targetObj.style.display="none";
                        if(openTip  &&  shutTip){
                            sourceObj.innerHTML = shutTip;
                        }
                    } else {
                        targetObj.style.display="block";
                        if(openTip  &&  shutTip){
                            sourceObj.innerHTML = openTip;
                        }
                    }
                }
            </script>

            <img src="<?=$avatar?>" />
            <h3><?= $bingli_detail->data['name']?></h3>
            <span><?= $bingli_detail->data['医院']?></span>
            <a href="###" onclick="openShutManager(this,'box3',false,'收起','……')">……</a>
            <div class="clear"></div>
            <p id="box3" style="display:none" style="display:block; margin-left:42px; "><?= $bingli_detail->data['description']?></p>
        </div>
        <div class="con">
            <?php
                for($i=1;$i<6;$i++){
                    if($bingli_detail->data['t'.$i]!='' && $bingli_detail->data['t'.$i]!='没有图片')echo "<img src='".$bingli_detail->data['t'.$i]."' style='width:100%'/>";
                }

            ?>

            <div><?= $bingli_detail->data['详情']?></div>
        </div>
        <!--回复循环 begin-->
        <div class="case_view_list">
            <ul>
                <?php foreach($pinglun_list['res'] as $key =>$value):
                $avatar = trim($value['头像']);
                if ($avatar=='没有图片'||$avatar=="") {
                $avatar = G_SITE_CDN .'/cache/card_img/top_index.jpg';
                }
                if (substr($avatar, 0, 4) != 'http') {
                $img_url = substr($avatar,2);
                $avatar = G_SITE_CDN . $img_url;
                }

                ?>
                <li>
                    <a>
                        <div><img src='<?=$avatar?>' /><h4><?=$value['name']?></h4><span><?php echo substr($value['时间'],0,10)?></span></div>
                       <?php if($value['pid']==0) {
                       ?>w
                           <p><?=$value['说明']?></p>
                       <?php
                       }else{
                        ?>
                           <p class="case_view_reply_return_p">回复<?=$value['pname']?>：<?=$value['说明']?></p>
                           <p class="case_view_reply_y_p"><?=$value['pname']?>：<?=$value['p说明']?></p>
                       <?php  } ?>
                    </a>
                    <div class="case_view_reply_return" pid="<?=$value['id']?>"><span>回复</span></div>
                </li>
                <?php  endforeach;  ?>
            </ul>

        </div>

        <!--回复循环 end-->
        <div class="pages" ><?=$pinglun_list['page'];?></div>

    </div> 
    <div style="width:100%;margin:0; overflow:hidden;"><img src="<?=G_SITE_CDN?>/business/img/banquan.gif" style= " width:100%; height:250px; margin:0 auto; " alt="版权声明" /></div>
    <div id="qq" style="display:none;" class="case_view_reply">
        <div class="box">
            <form action="" method="post" id="form_pl" style="text-align: center; width: 100%" >
                <div class="box_header">
                    <span>请输入评论内容：</span>
                    <div onclick="document.getElementById('qq').style.display='none'"></div>
                </div>
                <div class="txt">
                    <textarea name="说明" cols="" rows="" type="text" id="keyword" value="请输入互动内容…" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#DB3656'}"></textarea>
                </div>
                <div class="btn"><input type="submit" name="add" id="add_submit" value="发布" /></div>
                <input  type="hidden" name="pid" value="0" id="PID" />
            </form>
        </div>
    </div>



<?php require 'app/templates/common/download.html'; ?>
    <script>
        $(function(){
            //表单非空验证
            $("#add_submit").click(function(){
                $content= $.trim($('#keyword').val());
               if($content.length==0){
                   alert("请输入评论内容！");
                   return false;
               }
                $("#form_pl").submit();
            })

            $(".case_view_reply_return").click(function(){
                $("#qq").show();
                $("#PID").val($(this).attr("pid"));
            })
            $(".write").click(function(){
                $("#qq").show();
                $("#PID").val(0);
            })
        });

        wx.config({
            debug: false,
            appId: '<?php echo $this->signPackage["appId"];?>',
            timestamp: <?php echo $this->signPackage["timestamp"];?>,
        nonceStr: '<?php echo $this->signPackage["nonceStr"];?>',
                signature: '<?php echo $this->signPackage["signature"];?>',
                jsApiList: [
            'onMenuShareAppMessage',
            'onMenuShareTimeline',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone'
        ]
        });



        title = '<?= $bingli_detail->data['title']?>';
        desc = '<?= $desc?>';
        links = '';
        imgUrl = '<?= $avatar?>';
        weixinShare(title, desc, links, imgUrl);
</script>
    <?php require 'app/templates/common/foot.html'; ?>
</body>
</html>

